package com.atguigu;

import org.apache.ibatis.annotations.Mapper;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

/**
 * projectName: com.atguigu
 *
 * @author: 赵伟风
 * description:
 * 整合mybatis的步骤
 *   1. 导入场景启动器 （mybatis test jdbc lombok ）
 *   2. mybatis配置文件 - application.yml - mybatis... (mybatis-config.xml)
 *       mybatis:
 *          type-aliases-package: com.atguigu.pojo  #别名配置
 *          configuration: # settings
 *             map-underscore-to-camel-case: true  # setting
 *             auto-mapping-behavior: full
 *             log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
 *             lazy-loading-enabled: true
 *             aggressive-lazy-loading: false
 *          mapper-locations: classpath:mappers/*.xml # mapperxml位置
 *   3. 配置mapper接口的扫描  1. 启动类@MapperScan("com.atguigu.mapper") 2.单独配置Mapper -》 @Mapper
 *   4. 像以前一样，正常定义mapper接口和mapperxml文件 （xml resources/mapper）
 * 配置连接池信息： druid | springboot自带连接池
 *   springboot 3 | druid - starter -> springboot 2
 *   # 连接池
 *   spring:
 *     datasource:
 *       username: root
 *       password: root
 *       driver-class-name: com.mysql.cj.jdbc.Driver
 *       url: jdbc:mysql:///studb
 *       type: com.zaxxer.hikari.HikariDataSource #指定连接池类型
 */
@MapperScan("com.atguigu.mapper")
@SpringBootApplication
public class BootRunner {

    public static void main(String[] args) {
        SpringApplication.run(BootRunner.class,args);
    }
}
